home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Source Code / Visual Basic Source Code.iso / vbsource / vbmdixpl / floating.frm < prev    next >
Text File  |  1995-05-02  |  4KB  |  152 lines

  1. VERSION 2.00
  2. Begin Form FloatingToolbar 
  3.    BorderStyle     =   1  'Fixed Single
  4.    ClientHeight    =   1965
  5.    ClientLeft      =   6945
  6.    ClientTop       =   5145
  7.    ClientWidth     =   945
  8.    Height          =   2370
  9.    Left            =   6885
  10.    LinkTopic       =   "Form2"
  11.    MaxButton       =   0   'False
  12.    MinButton       =   0   'False
  13.    ScaleHeight     =   1965
  14.    ScaleWidth      =   945
  15.    Top             =   4800
  16.    Width           =   1065
  17.    Begin PictureBox SampleIcon 
  18.       DragMode        =   1  'Automatic
  19.       Height          =   492
  20.       Index           =   7
  21.       Left            =   480
  22.       Picture         =   FLOATING.FRX:0000
  23.       ScaleHeight     =   465
  24.       ScaleWidth      =   465
  25.       TabIndex        =   7
  26.       Top             =   1440
  27.       Width           =   492
  28.    End
  29.    Begin PictureBox SampleIcon 
  30.       DragMode        =   1  'Automatic
  31.       Height          =   492
  32.       Index           =   6
  33.       Left            =   0
  34.       Picture         =   FLOATING.FRX:0302
  35.       ScaleHeight     =   465
  36.       ScaleWidth      =   465
  37.       TabIndex        =   6
  38.       Top             =   1440
  39.       Width           =   492
  40.    End
  41.    Begin PictureBox SampleIcon 
  42.       DragMode        =   1  'Automatic
  43.       Height          =   492
  44.       Index           =   5
  45.       Left            =   480
  46.       Picture         =   FLOATING.FRX:0604
  47.       ScaleHeight     =   465
  48.       ScaleWidth      =   465
  49.       TabIndex        =   5
  50.       Top             =   960
  51.       Width           =   492
  52.    End
  53.    Begin PictureBox SampleIcon 
  54.       DragMode        =   1  'Automatic
  55.       Height          =   492
  56.       Index           =   4
  57.       Left            =   0
  58.       Picture         =   FLOATING.FRX:0906
  59.       ScaleHeight     =   465
  60.       ScaleWidth      =   465
  61.       TabIndex        =   4
  62.       Top             =   960
  63.       Width           =   492
  64.    End
  65.    Begin PictureBox SampleIcon 
  66.       DragMode        =   1  'Automatic
  67.       Height          =   492
  68.       Index           =   3
  69.       Left            =   480
  70.       Picture         =   FLOATING.FRX:0C08
  71.       ScaleHeight     =   465
  72.       ScaleWidth      =   465
  73.       TabIndex        =   3
  74.       Top             =   480
  75.       Width           =   492
  76.    End
  77.    Begin PictureBox SampleIcon 
  78.       DragMode        =   1  'Automatic
  79.       Height          =   492
  80.       Index           =   0
  81.       Left            =   0
  82.       Picture         =   FLOATING.FRX:0F0A
  83.       ScaleHeight     =   465
  84.       ScaleWidth      =   465
  85.       TabIndex        =   2
  86.       Top             =   0
  87.       Width           =   492
  88.    End
  89.    Begin PictureBox SampleIcon 
  90.       DragMode        =   1  'Automatic
  91.       Height          =   492
  92.       Index           =   2
  93.       Left            =   0
  94.       Picture         =   FLOATING.FRX:120C
  95.       ScaleHeight     =   465
  96.       ScaleWidth      =   465
  97.       TabIndex        =   1
  98.       Top             =   480
  99.       Width           =   492
  100.    End
  101.    Begin PictureBox SampleIcon 
  102.       DragMode        =   1  'Automatic
  103.       Height          =   492
  104.       Index           =   1
  105.       Left            =   480
  106.       Picture         =   FLOATING.FRX:150E
  107.       ScaleHeight     =   465
  108.       ScaleWidth      =   465
  109.       TabIndex        =   0
  110.       Top             =   0
  111.       Width           =   492
  112.    End
  113. End
  114. Declare Function SetWindowPos Lib "user" (ByVal h%, ByVal hb%, ByVal x%, ByVal y%, ByVal cx%, ByVal cy%, ByVal f%) As Integer
  115.  
  116. Sub Form_Load ()
  117.  
  118.  
  119.  
  120. Const SWP_NOMOVE = 2
  121. Const SWP_NOSIZE = 1
  122. Const FLAGS = SWP_NOMOVE Or SWP_NOSIZE
  123. Const HWND_TOPMOST = -1
  124. Const HWND_NOTOPMOST = -2
  125.  
  126. ' To set the form XXXX to TOPMOST, use the following code:
  127.  
  128. success% = SetWindowPos(Me.hWnd, HWND_TOPMOST, 0, 0, 0, 0, FLAGS)
  129.      'success% <> 0 When Successful
  130.  
  131. ' size the Toolbar:
  132.  
  133.   FloatingToolbar.Width = SampleIcon(1).Width * 2
  134.   FloatingToolbar.Height = SampleIcon(1).Height * 4 + 300 'empiric for the Titlebar
  135.  
  136. ' load the Drag Icons
  137. For i = 0 To 7
  138.  SampleIcon(i).DragIcon = SampleIcon(i).Picture
  139. Next
  140.  
  141. End Sub
  142.  
  143. Sub Form_QueryUnload (cancel As Integer, UnloadMode As Integer)
  144.  ' Fake an unload
  145.  cancel = 1 ' dont unload
  146.  Me.Visible = False ' but become invisble
  147.  ' reset the Menu-Option
  148.  MDIForm1.M_FloatingToolbar.Checked = False
  149.  
  150. End Sub
  151.  
  152.